package com.cy.pj.goods.dao;

import com.cy.pj.goods.pojo.Goods;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface GoodsDao {

    @Select("select * from tb_goods")
    List<Goods> findAllGoods();

    @Delete("delete from tb_goods where id =#{id}")
    void deleteById (Integer id);

    @Insert("insert into tb_goods (name,remark,createdTime) Values(#{name},#{remark},now())")
    void insert(Goods goods);

    @Select("select * from tb_goods where id =#{id}")
    Goods selectById(Integer id);

    @Update("update tb_goods set name=#{name},remark=#{remark} where id=#{id}")
    void update(Goods goods);
}
